<?php

/**
 * uniBoard Admin debugger template
 *
 * Light and fast forum solution for web 2.0-like communities.
 *
 * @package		uniBoard
 * @author		Rafał Pitoń
 * @license		http://www.gnu.org/licenses/gpl-3.0.html
 * @since		Version 0.1
 * 
 * ------------------------------------------------------------------------
 * 
 * $Date: 2010-09-06 00:40:22 +0000 (Mon, 06 Sep 2010) $
 * $Revision: 57 $
 * $Author: rafio.xudb@gmail.com $
 */

// ------------------------------------------------------------------------

class tpl_debug_raport extends class_templates_abstract{
	
	/**
	 * Main class pointer
	 *
	 * @var object
	 */
	
	private $appCore	= NULL;

	/**
	 * Zebras list
	 *
	 * @var array
	 */
	
	public $zebras 		= array();
	
	// ------------------------------------------------------------------------

	/**
	 * Creates ACP display class
	 *
	 * @param object $appCore
	 */
	
	function __construct( $appCore){
		
		// Store appCore pointer
		$this -> appCore = $appCore;
		
	}
	
	// ------------------------------------------------------------------------

	/**
	 * Draws Debug Body
	 *
	 * @param array $tpl_vars
	 * @return string
	 */
	
	function tpl_debug_body( $tpl_vars = array()){
		
		return '<div id="debug_body">
	<h1>' . $this -> appCore -> lang['debug_block_title'] . '</h1>
	<h2 class="block_title">' . $this -> appCore -> lang['debug_block_session_data'] . '</h2>
	<div class="table_border">
		' . $tpl_vars['session'] . '
	</div>
	<h2 class="block_title">' . $this -> appCore -> lang['debug_block_acl'] . '</h2>
	<div class="table_border">
		' . $tpl_vars['acl'] . '
	</div>
	<h2 class="block_title">' . $this -> appCore -> lang['debug_block_db_queries'] . '</h2>
	<div class="table_border">
		' . ( empty( $tpl_vars['db_queries']) ? '<div class="row_0"><div class="row_padding">' . $this -> appCore -> lang['debug_block_db_queries_none'] . '</div></div>' : $tpl_vars['db_queries']) . '
	</div>
</div>';
		
	}
	
	// ------------------------------------------------------------------------

	/**
	 * List Item
	 *
	 * @param array $tpl_vars
	 * @return string
	 */
	
	function tpl_list_item( $tpl_vars = array()){
		
		// Update zebras
		$this -> updateZebras( 'list_item');
		
		return '<div class="row_' . $this -> zebra( 'list_item', '1|0', '', '') . '">
	<div class="row_padding">
		<div class="left_float width_big cell">
			<b>' . $tpl_vars['item_title'] . '</b>
		</div>
		<div class="left_float left_border width_longer cell">
			' . $tpl_vars['item_value'] . '
		</div>
	</div>
</div>';
		
	}
	
	// ------------------------------------------------------------------------

	/**
	 * Draws Queries List Item
	 *
	 * @param array $tpl_vars
	 * @return string
	 */
	
	function tpl_query( $tpl_vars = array()){
		
		// Update zebras
		$this -> updateZebras( 'query');
		
		return '<div class="row_' . $this -> zebra( 'query', '1|0', '', '') . '">
	<div class="row_padding">
		<div class="cell">
			' . $tpl_vars['query_content'] . '
		</div>
	</div>
</div>';
		
	}
	
}